destroy method « API « JSP-Servlet Q&A





1. shall we call destroy from Init and service method in Servlet    stackoverflow.com

shall we call destroy from Init and service method in Servlet . I got many confused across the blogs . According to me when we call destroy method from init it ...

2. destroy() method of Servlet    bytes.com

"when the web container determines that a servlet should be removed from the service, it calls the destroy() method to allow the servlet to release any resources it is using. The ...

3. Overriding init() and destroy() methods in JSP document    bytes.com

Hello all, Can anyone please tell, is it possible to override the init() and destroy() methods of Servlet in JSP page. When I override the init() method then it gives no ...

4. How can destroy() method can be called explicitly    coderanch.com

Call to Destroy method of servlet is taken care by the container,special thing is we can also call destroy method but there is difference between the programmatic call and container call. Container call only release the all resources used by the servlet and our programmatic call execute as ordinary method call and doesnot release the resources allocated by the container. Is ...

5. when destroy method will call    coderanch.com

6. After calling destroy method in servlet    coderanch.com

Just make a call to destroy yourself. Believe me nothing is gonna happen. And if you override the destroy method and inside that place something like, System.out.println("hey i got a call"); then you will get it printed, but nothing else. As Ben said, "its a place for you to put a cleanup code, if necessary". cheers.

8. destroy() method of servlets    coderanch.com

I remember a post about this question being asked during an interview process... Only it was worded, "What will happen if you call the destroy() method from the service method?" In short, the answer is the container will execute whatever logic is in the destroy() method, and then return flow back to the service method, just like it would with any ...





10. destroy method of servlet    coderanch.com

13. destroy() method of servlet.    coderanch.com

The code would run, but the Servlet wouldn't actually be taken out of service. The destroy method is a method like any other method, but its purpose has to do with the lifecycle of the Servlet, which is managed by the web container. A developer should never call the init or destroy method of a Servlet. We just put pertinent code ...





17. Calling explicitly destroy method in service method of servlet?    coderanch.com

Hi, I have few questions: 1) Can we implement servlet service method and in that can we call explicitly destroy method? Will it work? 2) Can two different threads access two different synchronized methods of same object?(i mean simultaneously) 3) Say i have a synchronized method in a class and i have ten different threads with different priority and all threads ...

18. Init and Destroy method of servlet    coderanch.com

Hi Rahual, You are calling destroy() inside init but to use that, you are invoking servlet which is a REQUEST to a Web Container . so what happens is in order to respond to your request the servlet will be initalised(init) and service () method is invoked to do that. so the point is WHENEVER you are hitting a servlet means ...

20. Destroy method of servlet does not work    forums.oracle.com

21. Cant we use garbage collection instead of destroy method in servlets    forums.oracle.com

I just want to clarify is destroy() method necessary in servlets ? Garbage collector is for destroying the unused objects in case of servlets also after the service method if i can invoke garbage collector then is it sufficient rather than destroy() method ? Can anyone pls explain me this in detail.